package com.epfresh.supplier.entity;

import com.epfresh.api.utils.JsonUtils;

public class BaseStoreInfo {
   /* {
        "id": 130,
            "address": "宁夏银川市兴庆区null",
            "managerName": "刘金",
            "managerPhone": "13139593379",
            "name": "共创食材北环",
            "agentStatus": 1,
            "homepage": "http://storetest.epfresh.com/jdzg-gh-app/1.0.0/index/index.html#/index/100?store_id=5"
    }*/
    private String address;
    private String managerPhone;
    private String name;
    private String cityName;
    private String id;
    private String managerName;
    //1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办
    private String agentStatus;
    private String homepage;
    //我要买接口中的--->>1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办
    private String agentState;
    private String subjectType;
    public String getAgentState() {
        return agentState;
    }

    public void setAgentState(String agentState) {
        this.agentState = agentState;
    }
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getSubjectType() {
        return subjectType;
    }

    public void setSubjectType(String subjectType) {
        this.subjectType = subjectType;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getManagerPhone() {
        return this.managerPhone;
    }

    public void setManagerPhone(String managerPhone) {
        this.managerPhone = managerPhone;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getManagerName() {
        return this.managerName;
    }

    public void setManagerName(String managerName) {
        this.managerName = managerName;
    }
//服务器改了字段，为了兼容以前的字段，所以做了一个判断
    public String getAgentStatus() {
        if (agentStatus!=null){
            return this.agentStatus;
        }else {
            return agentState;
        }
    }
    public String getAgentStatusChs() {
        //1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办

        if ("1".equals(agentStatus)){
            return "申请中";
        }
        if ("2".equals(agentStatus)){
            return "代办中";
        }
/*        if ("3".equals(agentStatus)){
            return "拒绝代办";
        }*/
        if ("4".equals(agentStatus)){
            return "暂停代办";
        }
        return "申请代办";
    }
    public boolean isAgentStatus() {
        //1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办

        if ("1".equals(agentStatus)){
            return false;
        }
        if ("2".equals(agentStatus)){
            return false;
        }
/*        if ("3".equals(agentStatus)){
            return true;
        }*/
        if ("4".equals(agentStatus)){
            return false;
        }
        return true;
    }
    //我要买接口，修改statue为state
    public String getAgentStateChs() {
        //1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办

        if ("1".equals(agentState)){
            return "申请中";
        }
        if ("2".equals(agentState)){
            return "代办中";
        }
        if ("3".equals(agentState)){
            return "重新申请";
        }
        if ("4".equals(agentState)){
            return "暂停代办";
        }
        if ("5".equals(agentState)) {
            return "解除中";
        }
        return "申请代办";
    }
    //我要买接口，修改statue为state
    public boolean isAgentState() {
        //1申请中，2代办中，3拒绝代办，4暂停代办，其他申请代办

        if ("1".equals(agentState)){
            return false;
        }
        if ("2".equals(agentState)){
            return false;
        }
/*        if ("3".equals(agentStatus)){
            return true;
        }*/
        if ("4".equals(agentState)){
            return false;
        }
        return true;
    }



    public void setAgentStatus(String agentStatus) {
        this.agentStatus = agentStatus;
    }

    public String getHomepage() {
        return this.homepage;
    }

    public void setHomepage(String homepage) {
        this.homepage = homepage;
    }

    @Override
    public String toString() {
        return JsonUtils.toJson(this);
    }
}
